<template>
    <section class="main">
      <ul class="todo-list">
        <li class="todo" v-for="(item, index) in todos" :key="item.id">
          <div class="view">
            <span class="index">{{ index + 1 }}.</span> <label>{{ item.title }}</label>
            <button @click="del(item.id)" class="destroy"></button>
          </div>
        </li>
      </ul>
    </section>
  </template>
  
  <script>
  export default {
    props: {
      todos: {
        type: Array,
        required: true
      }
    },
    methods:{
      del(id){
        this.$emit('delTodo',id)
      }
    }
  }
  </script>
  
  <style></style>